/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cards;

import enums.CardTypes;

/**
 *
 * @author Oksana_Moroz
 */
public class StorageCard extends Card {

    protected int balance = 0;
    
    public StorageCard(long id) {
        super(id, CardTypes.COMMON);        
    }
    
    public void addMoney(int money) {
        balance += money;
    }
    
    @Override
    public boolean makeTrip() {
        if (balance >= PRICE_OF_TRIP) {
            balance -= PRICE_OF_TRIP;
            return true;
        } else {
            return false;
        }
    }
    
    @Override
    public String toString() {
        return "StorageCard: id = " + id + " type = " + type + " balance = " + balance;
    } 
}
